package com.shanxia.codec.enums;

import java.util.Objects;

public enum SingleVolGoalEnum {

    NOT_REACH(0x00, "未达到单体电压设定值"),
    REACH(0x01, "达到单体电压设定值"),
    UNTRUSTED(0x10, "不可信状态"),
    UNKNOWN(99, "未知");

    public static SingleVolGoalEnum getByCode(int code) {
        for (SingleVolGoalEnum enums : SingleVolGoalEnum.values()) {
            if (Objects.equals(enums.code, code)) {
                return enums;
            }
        }
        return SingleVolGoalEnum.UNKNOWN;
    }

    SingleVolGoalEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int code;
    public String name;
}